<?php

function rpc( $json_request ) {
    global $PARAPARA;

    $req_param = $json_request->param;

    if(!$req_param) {
        return new RPC_Error($json_request->operation, "PARAM", "No params");
    };

    $dbl = $PARAPARA->dblayer;


    $linkroll = $dbl->get_linkroll( );


    $rpc_retval = 
        array( 'html'        => $linkroll->as_html( null ),
               'link_count'  => $linkroll->link_count,
               'newest_id'   => $linkroll->newest_id
        );

    return new RPC_Response( $json_request->operation, $rpc_retval );

}

return rpc( $json_request );

?>